from kss.core import kssaction

from zope.component import getMultiAdapter

from plone.app.kss.plonekssview import PloneKSSView


class KSSMethods(PloneKSSView): 
    external_editor_selector = 'document-action-externalditor' 
 
    @kssaction 
    def extEditorView(self): 
 
        ksscore = self.getCommandSet('core') 
        replacediv = ksscore.getHtmlIdSelector(self.external_editor_selector) 

        applet = getMultiAdapter((self.context, self.request), name=u'externaleditor_applet')
        rData = applet() 
         
        ksscore.replaceInnerHTML(replacediv, rData)



